<template>
	<view>
		<view class="list">
			<view class="item" v-for="(item,index) in list">
				<image class="img" @click="clickImg(item.atlasId,item.atlasName,item.resourcesId)" :src="item.url"
					mode=""></image>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		props: {
			list: {},
			suffix: '',
		},
		data() {
			return {}
		},
		methods: {
			clickImg(atlasId, atlasName, resourcesId) {
				// 获取资源下，相同图集的资源
				this.$u.api.mine.getDownloadResourcesList({
					atlasId: atlasId,
					resourcesId: resourcesId,
					size: 10
				}).then(res => {
					if (res.code != 200) {
						this.$u.toast(res.msg)
						return
					}

					const imgList = encodeURIComponent(JSON.stringify(res.data));

					uni.navigateTo({
						url: "/pages/sys/home_bags/photodetail?imgList=" + imgList +
							"&selectIndex=0" +
							"&atlasName=" + atlasName +
							"&atlasId=" + atlasId
					})
				})
			},
		},


	}
</script>

<style lang="scss" scoped>
	.list {
		display: flex;
		flex-wrap: wrap;

		.item {
			margin-bottom: 15rpx;
			width: 219rpx;
			height: 433rpx;

			&:nth-child(3n-1) {
				margin: 0 15rpx;
			}

			.img {
				width: 219rpx;
				height: 433rpx;
				border-radius: 20rpx;
			}
		}
	}
</style>